package com.hooker.bean

import android.os.Parcel
import android.os.Parcelable

//id=Hooker.File , name=文件
data class TypeInfo(var id: String?, var name: String?, var type: String?) : Parcelable {
    var packageName: String? = null

    constructor(source: Parcel) : this(
        source.readString(),
        source.readString(),
        source.readString()
    )

    override fun describeContents() = 0

    override fun writeToParcel(dest: Parcel, flags: Int) = with(dest) {
        writeString(id)
        writeString(name)
        writeString(type)
    }

    companion object {
        @JvmField
        val CREATOR: Parcelable.Creator<TypeInfo> = object : Parcelable.Creator<TypeInfo> {
            override fun createFromParcel(source: Parcel): TypeInfo = TypeInfo(source)
            override fun newArray(size: Int): Array<TypeInfo?> = arrayOfNulls(size)
        }
    }
}